<%@ page contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/common/taglibs-popup.jsp" %>
<script type="text/javascript">

function assignRoleAndArea(id) {
	  Geni.Popup.showWindow({
	      url: "<g:url namespace='/account' action='preAssignRoleAndArea2User' includeParams='none'/>?id=" + id,
	      title: "分配权限",
	      width: 800,
	      height: 500,
	      returnCallback: function(data) {
	    	window.location.reload();
	        if (data != null) {
	        }
	      }//$j('.id').val()
	  });
	}
function create() {
	  Geni.Popup.showWindow({
	      url: "<g:url namespace='/account' action='preCreateUser' includeParams='none'/>",
	      title: "添加用户",
	      width: 800,
	      height: 500,
	      returnCallback: function(data) {
	     	// var dispatchUrl = "<g:url namespace='/module/order' action='ListSoSplited' includeParams='none' />";
	    	// window.parent.location = dispatchUrl ;
	    	window.location.reload();
	        if (data != null) {
	        }
	      }//$j('.id').val()
	  });
	}
function edit(id) {
	  Geni.Popup.showWindow({
	      url: "<g:url namespace='/account' action='preEditUser' includeParams='none'/>?id=" + id,
	      title: "修改用户",
	      width: 800,
	      height: 500,
	      returnCallback: function(data) {
	    	window.location.reload();
	        if (data != null) {
	        }
	      }//$j('.id').val()
	  });
	}

</script>


<g:toolbar>
	<g:button type="submit" key="user.create" cssClass="button" onclick="create();"/>
</g:toolbar>
<g:form namespace="/account" method="post" id="soForm">
  <g:panel key="use.list">
	<display:table class="dataTable" name="pageList" list="fullList" export="false" sort="external" 
        id="row" requestURI="listUser.action" decorator="org.ttitfly.ttcore.displaytag.ItemLineDecorator">
      <c:set value="${row}" scope="request" var="row" />
      <display:column
			title="<input type='checkbox' id='selectAll' onclick='selectA()'/>"
			style="width:3%;">
			<g:if test="#request.row.pod != true">
				<input type="checkbox" name="checkboxList" value="${row.id}" />
			</g:if>
			
		</display:column>
  	
      <display:column property="loginName" titleKey="label.loginName" sortable="true" sortProperty="customer.id" headerClass="sortable" />
  	  <display:column property="email" titleKey="label.email" sortable="true" headerClass="sortable" />
  	  <display:column property="name" titleKey="label.name" sortable="true" headerClass="sortable" />
  	  <display:column property="phoneCode" titleKey="label.phoneCode" sortable="true" headerClass="sortable" />
      <display:column titleKey="basicOperation" style="width:5%">
          <g:actionbar>
          	 <g:actionurl href="#" onclick="edit(\"%{#request.row.id}\")" title="%{getText('user.edit')}" status="true" imageSrc="%{imgBasePath}/common/edit.gif"/>
       		<g:actionurl href="deleteUser.action?Id=%{#request.row.id}" status="true" imageSrc="%{imgBasePath}/common/delete.gif" title="%{getText('delete')}"/>
          </g:actionbar>
      </display:column>
     <display:column titleKey="operation" style="width:5%">
         <g:actionbar>    
       		<g:actionurl href="#" onclick="assignRoleAndArea(\"%{#request.row.id}\")" title="%{getText('assign.role.area')}" status="true" imageSrc="%{imgBasePath}/add.gif"/>
       </g:actionbar>
     </display:column>
    </display:table>
  </g:panel>
</g:form>